.translation-bubble {
    position: absolute;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 12px;
    max-width: 300px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    animation: bubble-fade-in 0.2s ease;
}

@keyframes bubble-fade-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.translation-bubble::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.04);
}

.translation-bubble.bottom::before {
    top: auto;
    bottom: -6px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.04);
}

.translation-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.translation-bubble-title {
    font-weight: 500;
    color: #666;
    font-size: 12px;
}

.translation-bubble-close {
    cursor: pointer;
    padding: 4px;
    line-height: 0;
    border-radius: 4px;
}

.translation-bubble-close:hover {
    background: #f5f5f5;
}

.translation-bubble-content {
    margin-bottom: 12px;
    line-height: 1.5;
}

.original-text {
    color: #666;
    font-size: 12px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.translated-text {
    color: #333;
}

.translation-bubble-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.translation-bubble-button {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
    background: transparent;
}

.translation-bubble-button:hover {
    background: #f5f5f5;
    color: #333;
}

.translation-bubble-button.primary {
    background: #007bff;
    color: white;
}

.translation-bubble-button.primary:hover {
    background: #0056b3;
    color: white;
}

.translation-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.translation-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
